﻿Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports DevExpress.XtraEditors
Imports DevExpress.LookAndFeel
Imports DevExpress.XtraBars

Public Class SG_Control_Vuelos_Main1
    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub navBarItem_LinkClicked(ByVal sender As Object, ByVal e As DevExpress.XtraNavBar.NavBarLinkEventArgs) Handles VueloItem.LinkClicked, ReservaItem.LinkClicked, ManifiestoItem.LinkClicked, ValijaItem.LinkClicked, CManifiestoItem.LinkClicked, CValijaItem.LinkClicked, ViajeXTrabajadorItem.LinkClicked, LugarItem.LinkClicked, AeroLineaItem.LinkClicked, CuentasItem.LinkClicked, AnalisisItem.LinkClicked, TraCuentaItem.LinkClicked, AsientoItem.LinkClicked, ArriboItem.LinkClicked, PersonalItem.LinkClicked, ConsolidarItem.LinkClicked, UsuarioItem.LinkClicked

        Select Case Trim(e.Link.Item.Tag)
            Case "CONSOLIDAR"
                Dim sfrmConsolidar As New frmAdm_ConsolidaFactura
                sfrmConsolidar.Text = "Consolidar Factura"
                '             sfrmAsnto.BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                '             sfrmAsnto.BarBtnEliminar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                '             sfrmAsnto.BarBtnModificar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                '             sfrmAsnto.BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmConsolidar.SLTitulo.Text = sfrmConsolidar.Text
                sfrmConsolidar.ShowDialog()
            Case "PERSONAL"
                Dim sfrmPer As frmPer_Movimiento = New frmPer_Movimiento()
                sfrmPer.Text = "Movimiento de Personal"
                sfrmPer.BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmPer.BarBtnEliminar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmPer.BarBtnModificar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmPer.BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmPer.SLTitulo.Text = sfrmPer.Text
                sfrmPer.RibbonPage1.Visible = True
                sfrmPer.ShowDialog()
            Case "ARRIBO"
                Dim sfrmMani As frmChk_Arribo = New frmChk_Arribo()
                sfrmMani.Text = "Verificar Arribo "
                sfrmMani.BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnEliminar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnModificar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.SLTitulo.Text = sfrmMani.Text
                sfrmMani.RibbonPage1.Visible = True
                sfrmMani.ShowDialog()
            Case "VUELO"
                Dim formulario As New frmAdm_ProgramaViaje
                formulario.Text = "Mantenimiento de Vuelos"
                formulario.SLTitulo.Text = formulario.Text
                formulario.Show()
            Case "RESERVA"
                Dim formulario As New frmAdm_Reserva
                formulario.Text = "Registro de Reservas"
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "MANIFIESTO"
                Dim sfrmMani As frmAdm_Manifiesto = New frmAdm_Manifiesto()
                sfrmMani.Text = "Administrar Manifiesto"
                sfrmMani.BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnEliminar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnModificar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.BarBtnCancelar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmMani.SLTitulo.Text = sfrmMani.Text
                sfrmMani.RibbonPage1.Visible = True
                sfrmMani.ShowDialog()
            Case "VALIJA"
                Dim sfrmValija As frmAdm_ValijaLista = New frmAdm_ValijaLista()
                sfrmValija.Text = "Lista de Valijas"
                sfrmValija.RibbonPage1.Visible = True
                sfrmValija.BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmValija.BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmValija.BarBtnCancelar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmValija.SLTitulo.Text = sfrmValija.Text
                sfrmValija.ShowDialog()
            Case "VIAJE"
                Dim formulario As New frmConsultarViajeXTrabajador
                formulario.Text = "Viajes X Trabajador "
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "LUGAR"
                Dim formulario As New frmTabla_MLugar
                formulario.Text = "Lugares "
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "AEROLINEA"
                Dim formulario As New frmTabla_MEmpresa
                formulario.Text = "Aerolineas "
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "CUENTAS"
                Dim formulario As New frmMaestroCuentas
                formulario.Text = "Cuentas"
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "ANALISIS"
                Dim formulario As New frmMaestroAnalisis
                formulario.Text = "Analisis"
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "TRACUENTA"
                Dim formulario As New frmMaestroTrabajadorCuenta
                formulario.Text = "Trabajador Cuenta"
                formulario.SLTitulo.Text = formulario.Text
                formulario.ShowDialog()
            Case "ASIENTO"
                Dim sfrmAsnto As New frmAdm_Asiento
                sfrmAsnto.Text = "Provisión de Asiento"
                '             sfrmAsnto.BarBtnAgregar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                '             sfrmAsnto.BarBtnEliminar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                '             sfrmAsnto.BarBtnModificar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                '             sfrmAsnto.BarBtnGrabar.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
                sfrmAsnto.SLTitulo.Text = sfrmAsnto.Text
                sfrmAsnto.ShowDialog()
            Case "USUARIO"
                Dim sfrmUsuario As New frmSeg_Usuario
                sfrmUsuario.Text = "Usuarios"
                sfrmUsuario.SLTitulo.Text = sfrmUsuario.Text
                sfrmUsuario.ShowDialog()
        End Select
    End Sub

    Private Sub BarBtnExit_ItemClick(sender As System.Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarBtnExit.ItemClick
        Close()
    End Sub

    Private Sub SG_Control_Vuelos_Main1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        My.MySettings.Default("ApplicationSkinName") = UserLookAndFeel.Default.SkinName
        My.MySettings.Default.Save()
    End Sub
End Class

Public Class MyDesignTimeSkinsBarMenuHelper
    Inherits Component

    Private _BarManager As BarManager
    Public Property BarManager() As BarManager
        Get
            Return _BarManager
        End Get
        Set(ByVal value As BarManager)
            _BarManager = value
            CreateMenu()
        End Set
    End Property

    Private _LookAndFeel As DefaultLookAndFeel
    Public Property LookAndFeel() As DefaultLookAndFeel
        Get
            Return _LookAndFeel
        End Get
        Set(ByVal value As DefaultLookAndFeel)
            _LookAndFeel = value
            CreateMenu()
        End Set
    End Property

    Private Sub CreateMenu()
        If BarManager IsNot Nothing AndAlso LookAndFeel IsNot Nothing Then
            If DesignMode Then
                Dim TempMySkinsBarMenuHelper As MySkinsBarMenuHelper = New MySkinsBarMenuHelper(BarManager, LookAndFeel)
            Else
                Dim form As Form = TryCast(BarManager.Form, Form)
                If form IsNot Nothing Then
                    AddHandler form.Load, AddressOf form_Load
                End If
            End If
        End If
    End Sub

    Private Sub form_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim TempMySkinsBarMenuHelper As MySkinsBarMenuHelper = New MySkinsBarMenuHelper(BarManager, LookAndFeel)
        UserLookAndFeel.Default.ActiveLookAndFeel.SkinName = My.MySettings.Default("ApplicationSkinName").ToString()
        Dim oDialogResult As System.Windows.Forms.DialogResult
        Dim frmLg As New frmLogin
        oDialogResult = frmLg.ShowDialog()
        If oDialogResult = System.Windows.Forms.DialogResult.OK Then
        Else
            Global.System.Windows.Forms.Application.Exit()
        End If
    End Sub

    Public Sub New()
    End Sub
End Class